1 package jrre.instructionset.push;
2
3 import jrre.*;
4 import jrre.types.*;
5
6 public class Dup extends jrre.instructionset.Instruction {
7
8 public Dup(){
9
10 name = "dup";
11 description = "foo foo moo poo";
12 length = 0;
13 }
14
15 /***
16 * Executes the <strong><code>dup</code></strong> instruction.
17 *
18 * @param stackFrame
19 */
20 public void execute(){
21
22 Type toDup = Stack.popOperand();
23
24 //if(jrre.JRRE.getVerbose())
25 // System.out.println("poped in dup: "+toDup);
26
27 Stack.pushOperand(toDup);
28 Stack.pushOperand(toDup);
29
30 }
31
32 public String toString(){
33 StringBuffer toReturn = new StringBuffer();
34 toReturn.append("dup");
35
36 return toReturn.toString();
37 }
38 }
This page was automatically generated by Maven